//
//  YDOAMyApplyVC.swift
//  YDOAProduct
//
//  Created by 占益民 on 2017/11/27.
//  Copyright © 2017年 Allen. All rights reserved.
//

import UIKit
import SMSwipeableTabView
class YDOAMyApplyVC: UIViewController  {
    
    let titleBarDataSource = ["办公用品", "月度需求", "急性物品", "派车", "固定资产","费用报销"]
    let vcArr  = NSMutableArray()
    
//    let swipeableView = SMSwipeableTabViewController()
    override func viewDidLoad() {
        super.viewDidLoad()
        title = "我的申请"
        self.navigationController?.navigationBar.isHidden = false
        self.automaticallyAdjustsScrollViewInsets = false
        self.edgesForExtendedLayout = .init(rawValue: 0)
        
        addChildVC()
        let ninaPageView = NinaPagerView(frame:   CGRect(x: 0, y: 0, width: ScreenWidth, height: ScreenHeight - 64), withTitles: titleBarDataSource, withVCs: vcArr as! [Any])
        ninaPageView?.ninaPagerStyles = .bottomLine
        view.addSubview(ninaPageView!)
    }

    fileprivate func addChildVC() {
        for i in 1...titleBarDataSource.count{
            switch i {
                case 1://办公申请
                    let vc = YDOAMyBanApplyVC()
                    vc.applyType = 1
                    self.vcArr.add(vc)
                    break;
                case 2://月度需求申请
                    let vc = YDOAMyBanApplyVC()
                    vc.applyType = 2
                    self.vcArr.add(vc)
                    break;
                case 3: //急性
                    let vc = YDOAMyActueApplyVC()
                    vc.applyType = 1
                    self.vcArr.add(vc)
                    break;
                case 4: // 派车申请
                    let vc = YDOAMyCarApplyVC()
                    self.vcArr.add(vc)
                    break;
                case 5: // 固定资产
                    let vc = YDOAMyActueApplyVC()
                    vc.applyType = 2
                    self.vcArr.add(vc)
                    break;
                case 6: // 费用报销
                    let vc = YDOAExpenseApplyVC()
                    self.vcArr.add(vc)
                    break;
            default:
                break;
            }
        }
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    


}
